#include <PID.h>

float chaog_value;
uint pwm_value=0,pwm_dly;
float pid_pwm_value_num,speed;
void main()
{
	Timer0Init();
	Timer1Init();
	
	UartInit();
	pid_init();
	EA=1;
	while(1)
	{
//		chaog_value=main_chaog();

//		pid_pwm_value();
		float pid_pwm_value_num=pid_value(200.0);
//		printf("chaog_value_main=%4.2f\r\n",chaog_value);
		printf("pid_pwm_value_num=%f\r\n",pid_pwm_value_num);
	}
}


void time1() interrupt 3
{
	if(++pwm_dly==speed)pwm_dly=1;
	
	if(pwm_dly<pid_pwm_value_num){pwm=1;pwm_one=1;}
	else {pwm=0;pwm_one=0;}

	
	//	if(pwm_dly<pwm_value){pwm=1;pwm_one=1;}
//	else {pwm=0;pwm_one=0;}
}

